package com.xiaotu.spring.config;

import com.xiaotu.spring.service.TestScopeBean;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;

/**
 * @author zhangxiao
 * @create 2021-11-12 17:16
 */
@Configuration
public class ScopeConfig {

    @Bean
    @Scope(scopeName = ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode = ScopedProxyMode.TARGET_CLASS)
    public TestScopeBean testScopeBean() {
        return new TestScopeBean();
    }

}
